<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Uploadify</title>
<!-- <link href="css/default.css" rel="stylesheet" type="text/css" /> -->
<link href="/websrc/js/uploadify3.2.1/uploadify.css" rel="stylesheet"
	type="text/css" />
<script type="text/javascript"
	src="/websrc/js/jquery/jquery-1.7.1.min.js"></script>
<!-- <script type="text/javascript" src="/websrc/js/swfobject.js"></script> -->
<script type="text/javascript"
	src="/websrc/js/uploadify3.2.1/jquery.uploadify.min.js"></script>
<script type="text/javascript">
	$(function() {
		var selectedFile = [];
		$("#uploadify").uploadify(
				{
					'uploader' : '/batch/upload',
					'swf' : '/websrc/js/uploadify3.2.1/uploadify.swf',
					'cancelImg' : '/websrc/js/uploadify3.2.1/cancel.png',
					//'folder'         : 'uploads',
					'queueID' : 'fileQueue',
					'auto' : false,
					'multi' : true,
					'buttonText' : '选择上传文件',
					'onUploadStart' : function(file) {
						$("#uploadify").uploadify('settings', 'formData', {
							'keyword' : $('#keyword').val(),
							'pkgImg'  : $('#pkgImg').val()
						});
					},
					'onSelect' : function(file) {
						selectedFile[selectedFile.length] = file.name;
						$('#pkgImg').append('<option value="'+file.name+'">'
										+ file.name
										+ '</option>')
					},
					'onQueueComplete'	: function(queueData){
						$('#keyword').val(null);
						$('#pkgImg').empty();
					}
				//'simUploadLimit' : 2,
				//'buttonText'     : 'BROWSE'
				});
	});
</script>
</head>
<body>
	<div id="main" style="margin:0 auto;width:90%;">
		<div id="top" style="height: 15%;margin-bottom: 15px;background-color:#ccc;"></div>
		<div id="center" style="height: 65%;">
			<div id="fileQueue"></div>
			表情包关键字：<input type="text" id="keyword" name="exppkg" /><br/>
			表情包默认显示图片：<select id="pkgImg"></select>
			<input type="file" name="file" id="uploadify" />
			<p>
				<a id="upload" style="text-decoration: none;"
					href="javascript:$('#uploadify').uploadify('upload','*')"> 开始上传</a>&nbsp;
				<a id="cancel" style='display: none'
					href="javascript:jQuery('#uploadify').uploadifyClearQueue()">取消所有上传</a>
			</p>
		</div>
		<div id="footer" style="height: 15%;margin-top: 15px;background-color:#ccc;"></div>
	</div>
</body>
</html>